<div class="main_body">
	<div id="left_column">
    <?php echo $this->element('main_menu')?>
    </div>    	
	<div id="main_body_content">
	
		<div class="messages view">
		<h1><?php  __("Message");?></h1>
			<dl><?php $i = 0; $class = ' class="altrow"';?>
				
				<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('From'); ?></dt>
				<dd<?php if ($i++ % 2 == 0) echo $class;?>>
					<?php
						$from_user_id = $message['Message'][(($message['Message']['status']==1 || $message['Message']['status']== 3 || $message['Message']['status']== 41)?'fromto_':'').'user_id'];
						$name = (isset($users[$from_user_id]['name'])) ? $users[$from_user_id]['name'] : '';
						$surname = (isset($users[$from_user_id]['surname'])) ? $users[$from_user_id]['surname'] : '';
						
						
						echo $this->Html->link($name." ".$surname, array('action' => 'add', $message['Message']['user_id'])); ?>
					&nbsp;
				</dd>
				<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('To'); ?></dt>
				<dd<?php if ($i++ % 2 == 0) echo $class;?>>
					<?php 
						$to_user_id = $message['Message'][(($message['Message']['status']==2 || $message['Message']['status']==42)?'fromto_':'').'user_id'];
						echo $this->Html->link($name." ".$surname, array( 'action' => 'add', $message['Message']['fromto_user_id'])); ?>
					&nbsp;
				</dd>
				<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Date'); ?></dt>
				<dd<?php if ($i++ % 2 == 0) echo $class;?>>
					<?php echo $message['Message']['added']; ?>
					&nbsp;
				</dd>
								
				<dt<?php if ($i % 2 == 0) echo $class;?>><?php __("Subject"); ?></dt>
				<dd<?php if ($i++ % 2 == 0) echo $class;?>>
					<?php echo $message['Message']['name']; ?>
					&nbsp;
				</dd>
				<div class="clr"></div>
				<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Content'); ?></dt>
				<dd<?php if ($i++ % 2 == 0) echo $class;?>>
					<?php echo $message['Message']['content']; ?>
					&nbsp;
				</dd>
			</dl>
		</div>
		
		<div class="clr"></div>	
	</div>			
	<?php echo $this->element('languages')?>	
	<div class="clr"></div>
</div>	
<div class="clr"></div>	
<div class="main_action">
	<div class="main_action_content">
			
		<div class="actions">
			<h3><?php __('Actions'); ?></h3>
			<ul>
				<li><?php echo $this->Html->link($html->image(HOST.'/actions_message_edit.png'), array( 'action' => 'edit',$message['Message']['id']),array('escape'=>false,'title'=>__("Edit Message", true))); ?> <div class="clr"></div> <?php echo __("Edit Message", true)?></li>
				<li><?php echo $this->Html->link($html->image(HOST.'/actions_message_delete.png'), array( 'action' => 'delete',$message['Message']['id']),array('escape'=>false,'title'=>__("Delete Message", true)), sprintf(__("Are you sure you want to delete # %s?", true), $message['Message']['id'])); ?> <div class="clr"></div> <?php echo __("Delete Message", true)?></li>
				<li><?php echo $this->Html->link($html->image(HOST.'/actions_message_add.png'), array( 'action' => 'add'),array('escape'=>false,'title'=>__("New Message", true))); ?> <div class="clr"></div> <?php echo __("New Message", true)?></li>
				<li><?php echo $this->Html->link($html->image(HOST.'/actions_message_inbox.png'), array( 'action' => 'index',1),array('escape'=>false,'title'=>__("Inbox", true))); ?> <div class="clr"></div> <?php echo __("Inbox", true)?></li>
				<li><?php echo $this->Html->link($html->image(HOST.'/actions_message_outbox.png'), array( 'action' => 'index',2),array('escape'=>false,'title'=>__("Outbox", true))); ?> <div class="clr"></div> <?php echo __("Outbox", true)?></li>				
				<li><?php echo $this->Html->link($html->image(HOST.'/actions_message_archivies.png'), array( 'action' => 'index',3),array('escape'=>false,'title'=>__("Archives", true))); ?> <div class="clr"></div> <?php echo __("Archives", true)?></li>				
				<li><?php echo $this->Html->link($html->image(HOST.'/actions_messages_deleted.png'), array( 'action' => 'index',4),array('escape'=>false,'title'=>__("Deleted Items", true))); ?> <div class="clr"></div> <?php echo __("Deleted Items", true)?></li>
			</ul>
		</div>
		
		<div class="clr"></div>
	</div>		
</div>	